package com.cx.core.common.exception;

import com.cx.core.common.constant.ErrorEnum;

public class ServiceException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private String code;

    private String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public ServiceException() {}

    public ServiceException(ErrorEnum errorEnum) {
        this.code = errorEnum.getCode();
        this.msg = errorEnum.getMsg();
    }
}
